package datos;

// Generated 14/03/2010 01:41:37 by Hibernate Tools 3.2.4.GA

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

/**
 * Caja generated by hbm2java
 */
@Entity
@Table(name = "caja", catalog = "peluqueria", uniqueConstraints = @UniqueConstraint(columnNames = "fecha"))
public class Caja implements java.io.Serializable {

	private Integer idCaja;
	private Date fecha;
	private Double totalFacturado;
	private Double saldoEfectivo;
	private Double saldoInicial;
	private double totalRetiros;
	private Set<Retiro> retiros = new HashSet<Retiro>(0);

	public Caja() {
	}

	public Caja(Date fecha, double totalRetiros) {
		this.fecha = fecha;
		this.totalRetiros = totalRetiros;
	}

	public Caja(Date fecha, Double totalFacturado, Double saldoEfectivo,
			Double saldoInicial, double totalRetiros, Set<Retiro> retiros) {
		this.fecha = fecha;
		this.totalFacturado = totalFacturado;
		this.saldoEfectivo = saldoEfectivo;
		this.saldoInicial = saldoInicial;
		this.totalRetiros = totalRetiros;
		this.retiros = retiros;
	}

	public Caja(Date fecha2) {
		fecha=fecha2;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID_caja", unique = true, nullable = false)
	public Integer getIdCaja() {
		return this.idCaja;
	}

	public void setIdCaja(Integer idCaja) {
		this.idCaja = idCaja;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "fecha", unique = true, nullable = false, length = 19)
	public Date getFecha() {
		return this.fecha;
	}

	public void setFecha(Date fecha) {
		this.fecha = fecha;
	}

	@Column(name = "total_facturado", precision = 22, scale = 0)
	public Double getTotalFacturado() {
		return this.totalFacturado;
	}

	public void setTotalFacturado(Double totalFacturado) {
		this.totalFacturado = totalFacturado;
	}

	@Column(name = "saldo_efectivo", precision = 22, scale = 0)
	public Double getSaldoEfectivo() {
		return this.saldoEfectivo;
	}

	public void setSaldoEfectivo(Double saldoEfectivo) {
		this.saldoEfectivo = saldoEfectivo;
	}

	@Column(name = "saldo_inicial", precision = 22, scale = 0)
	public Double getSaldoInicial() {
		return this.saldoInicial;
	}

	public void setSaldoInicial(Double saldoInicial) {
		this.saldoInicial = saldoInicial;
	}

	@Column(name = "total_retiros", nullable = false, precision = 22, scale = 0)
	public double getTotalRetiros() {
		return this.totalRetiros;
	}

	public void setTotalRetiros(double totalRetiros) {
		this.totalRetiros = totalRetiros;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "caja")
	public Set<Retiro> getRetiros() {
		return this.retiros;
	}

	public void setRetiros(Set<Retiro> retiros) {
		this.retiros = retiros;
	}

}
